from datetime import datetime
from typing import Optional

from pydantic import BaseModel, Field


class BaseRotorType(BaseModel):
    id: int
    name: str
    preset_speed: int
    desc: Optional[str] = None
    created_at: Optional[datetime]
    updated_at: Optional[datetime]


class RotorTypeCreate(BaseModel):
    name: str = Field(example="单旋翼", description="旋翼类型名称")
    preset_speed: int = Field(example=1000, description="预设转速")
    desc: Optional[str] = Field(default=None, example="单旋翼描述", description="描述")


class RotorTypeUpdate(BaseModel):
    id: int = Field(example=1, description="旋翼类型ID")
    name: str = Field(example="单旋翼", description="旋翼类型名称")
    preset_speed: int = Field(example=1000, description="预设转速")
    desc: Optional[str] = Field(default=None, example="单旋翼描述", description="描述")


class RotorTypeList(BaseModel):
    items: list[BaseRotorType]
    total: int 